Optimal. Leaf size=48 \[ -\frac {\tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {2 i \sec (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3581, 3855}
\begin {gather*} -\frac {\tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {2 i \sec (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3581
Rule 3855
Rubi steps
\begin {align*} \int \frac {\sec ^3(c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=\frac {2 i \sec (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )}-\frac {\int \sec (c+d x) \, dx}{a^2}\\ &=-\frac {\tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {2 i \sec (c+d x)}{d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(184\) vs. \(2(48)=96\).
time = 0.22, size = 184, normalized size = 3.83 \begin {gather*} -\frac {\sec ^2(c+d x) \left (\cos \left (\frac {1}{2} (c+d x)\right ) \left (2 i+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (2+i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-i \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {3}{2} (c+d x)\right )+i \sin \left (\frac {3}{2} (c+d x)\right )\right )}{a^2 d (-i+\tan (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 54, normalized size = 1.12
method | result | size |
derivativedivides | \(\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {4}{-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{a^{2} d}\) | \(54\) |
default | \(\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {4}{-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{a^{2} d}\) | \(54\) |
risch | \(\frac {2 i {\mathrm e}^{-i \left (d x +c \right )}}{a^{2} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{2} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{2} d}\) | \(61\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 117 vs. \(2 (44) = 88\).
time = 0.52, size = 117, normalized size = 2.44 \begin {gather*} -\frac {-2 i \, \arctan \left (\cos \left (d x + c\right ), \sin \left (d x + c\right ) + 1\right ) - 2 i \, \arctan \left (\cos \left (d x + c\right ), -\sin \left (d x + c\right ) + 1\right ) - 4 i \, \cos \left (d x + c\right ) + \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right )^{2} + \sin \left (d x + c\right )^{2} - 2 \, \sin \left (d x + c\right ) + 1\right ) - 4 \, \sin \left (d x + c\right )}{2 \, a^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 64, normalized size = 1.33 \begin {gather*} -\frac {{\left (e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - e^{\left (i \, d x + i \, c\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 2 i\right )} e^{\left (-i \, d x - i \, c\right )}}{a^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\sec ^{3}{\left (c + d x \right )}}{\tan ^{2}{\left (c + d x \right )} - 2 i \tan {\left (c + d x \right )} - 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.62, size = 57, normalized size = 1.19 \begin {gather*} -\frac {\frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {\log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} - \frac {4}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.50, size = 44, normalized size = 0.92 \begin {gather*} -\frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}+\frac {4{}\mathrm {i}}{a^2\,d\,\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________